package com.inspire.myapp;

import java.util.Collections;
import java.util.Enumeration;

import com.codename1.ui.ComboBox;
import com.codename1.ui.Container;
import com.codename1.ui.Image;
import com.codename1.ui.layouts.BoxLayout;
import com.codename1.ui.layouts.Layout;
import com.codename1.ui.table.TableLayout;
import com.codename1.ui.table.TableLayout.Constraint;

public class menutab_list_tag extends Container {

	public menutab_list_tag() {
		
		this.setScrollableY(true);
		this.setRTL(true);
		TableLayout tab1l=new TableLayout(1, 2);
		this.setLayout(tab1l);
			/*Colonne de gauche*/
			Container tab1l1c = new Container();
			BoxLayout tab1l1 = new BoxLayout(BoxLayout.Y_AXIS);
			tab1l1c.setLayout(tab1l1);
			this.addComponent(0,tab1l1c);
			TableLayout.Constraint c=(Constraint) tab1l.getComponentConstraint(tab1l1c);
			c.setWidthPercentage(50);				
			
			/*Colonne du milieu*/
			Container tab1l2c = new Container();
			BoxLayout tab1l2 = new BoxLayout(BoxLayout.Y_AXIS);
			tab1l2c.setLayout(tab1l2);
			this.addComponent(0,tab1l2c);
			c=(Constraint) tab1l.getComponentConstraint(tab1l2c);
			c.setWidthPercentage(50);
			
			/*Colonne de droite*/
			/*Container tab1l3c = new Container();
			BoxLayout tab1l3 = new BoxLayout(BoxLayout.Y_AXIS);
			tab1l3c.setLayout(tab1l3);
			this.addComponent(0,tab1l3c);
			c=(Constraint) tab1l.getComponentConstraint(tab1l3c);
			c.setWidthPercentage(33);*/
			
			Enumeration<String> keys=objets.obj.tags.keys();
			
			final ComboBox<tag> tagscombo = new ComboBox<tag>();
			tagscombo.setUIID("TextField");
			while (keys.hasMoreElements()) {
				String  id= (String) keys.nextElement();
				tag tt=(tag) objets.obj.tags.get(id);

				tag_widget wtemp=new tag_widget(tt);
				tab1l1c.addComponent(wtemp);
			
				if (keys.hasMoreElements()){
					 id= (String) keys.nextElement();
					 tt=(tag) objets.obj.tags.get(id);

					 wtemp=new tag_widget(tt);
					 tab1l2c.addComponent(wtemp);
				}
			/*	if (keys.hasMoreElements()){
					 id= (String) keys.nextElement();
					 tt=(tag) objets.obj.tags.get(id);

					 wtemp=new tag_widget(tt);
					 tab1l3c.addComponent(wtemp);
				}*/
			}
					
	}

	public menutab_list_tag(Layout layout) {
		super(layout);
		// TODO Auto-generated constructor stub
	}

}
